package com.cari.oa.domain;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.validator.constraints.Length;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * 系统模块实体类
 * User: yexuhui
 * Date: 12-12-12
 * Time: 下午9:29
 */
@Entity
@Table(name = "T_SYS_MODULE")
public class SysModuleEntity implements Serializable {

    private static final long serialVersionUID = 1612989746817484254L;

    @Id
    @Length(max = 32)
    @GeneratedValue(generator = "system-uuid")
    @GenericGenerator(name = "system-uuid", strategy = "uuid")
    private String id;

    @Length(max = 32, message = "所属父模块ID长度要小于32个字符")
    @Column(name = "parent_id")
    private String parentId;

    @NotNull(message = "英文名不能为空")
    @Length(max = 32, min = 6, message = "英文名长度在6~32个字符之间")
    private String enname;

    @Length(max = 32, min = 2, message = "别名长度在2~32个字符之间")
    private String alias;

    @Length(max = 250, message = "URL长度不能超过250个字符")
    private String url;

    @NotNull(message = "序号不能为空")
    private Integer orderNum = 1;

    @NotNull
    private Integer status = 0;

    @Column(name = "create_time")
    private Date createTime = new Date();

    private String remark;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getEnname() {
        return enname;
    }

    public void setEnname(String enname) {
        this.enname = enname;
    }

    public String getAlias() {
        return alias;
    }

    public void setAlias(String alias) {
        this.alias = alias;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Integer getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(Integer orderNum) {
        this.orderNum = orderNum;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
}
